package spring.cloud.service.task.service;


import spring.cloud.service.task.domain.zooKeeperAndNamespace.ZooKeeper;
import spring.cloud.service.task.dto.NamespaceDto;
import spring.cloud.service.task.utils.PageInfo;
import spring.cloud.service.task.utils.Result;
import spring.cloud.tasks.common.curator.CuratorInfo;

import java.util.HashMap;
import java.util.List;

public interface ZooKeeperService {
    PageInfo getZooKeeperList(String description, String status, Integer page, Integer limit);

    Result addZooKeeper(String zooKeeperKey, String description, String addressList, String digest, String status) throws RuntimeException;

    Result updateZooKeeper(String zooKeeperKey, String description, String addressList, String digest, String status) throws RuntimeException;

    Result updateZooKeeperStatus(String zooKeeperKey, String status);

    Result deleteZooKeeper(String zooKeeperKey) throws RuntimeException;

    //
    List<HashMap<String, String>> getZooKeeperKeyAndDescriptionList();

    PageInfo getNamespaceList(String zookeeperKey, String description, String status, Integer page, Integer limit);

    //
    Result addNamespace(NamespaceDto namespaceDto, String userId) throws RuntimeException;

    Result updateNamespace(NamespaceDto nameSpaceDto, String userId);

    Result updateNamespaceStatus(String namespaceKey, String status);

    Result deleteNamespace(String nameSpace) throws RuntimeException;

    Result getNamespaceKeyAndDescriptionList();

    //
    CuratorInfo getCuratorInfo(String namespaceKey);

    List<CuratorInfo> getCuratorInfoList(String zookeeperKey);

    //
    List<ZooKeeper> getOnlineZooKeeperList();

    ZooKeeper getZooKeeper(String zooKeeperKey);


}
